<?php 
namespace backend\controllers;
use Yii;
use backend\controllers\CommontController;
use backend\models\post\JobPost;
use yii\db\query;

class PostController extends CommontController
{	
    //所有招聘的信息
     public function actionList()
     {   
        //展示所有的信息 查询对应关联ID并替换对应数据
         $query = new Query();
         $info = $query->from("job_recruit")->All();
         foreach ($info as $key => $value) 
         {
             $c_id = $value['c_id'];
             $region_id = $value['region_id'];
             $post_id = $value['post_id'];
             $company = $query->select("name")->from("job_company")->where(['id'=>$c_id])->One();
             $info[$key]['c_id'] = $company['name'];
             $region = $query->select("name")->from("job_region")->where(['id'=>$region_id])->One();
             $info[$key]['region_id'] = $region['name'];
             $post = $query->select("name")->from("job_post")->where(['id'=>$post_id])->One();
             $info[$key]['post_id'] = $post['name'];
         }
         return $this->render('list',['list'=>$info]);
     }
     public function FunctionDefault()
     {
         echo "默认页面666";
     }






}


 ?>